package com.springboot.erp.controller;

import com.springboot.erp.common.CommonResult;
import com.springboot.erp.entity.JshMaterialCurrentStock;
import com.springboot.erp.service.JshMaterialCurrentStockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;

@RestController
@RequestMapping("/materialReduce")
@Slf4j
public class MaterialReduceController {
    @Resource
    private JshMaterialCurrentStockService jshCurrentService;
    @PutMapping
    public CommonResult addMaterial(@RequestBody JshMaterialCurrentStock jshMaterialCurrentStock, @RequestParam BigDecimal number) {
        log.info("jshMaterialCurrentStock: {}", jshMaterialCurrentStock);
        jshCurrentService.reduceMaterialCurrent(jshMaterialCurrentStock,number);
        return new CommonResult(0, "success", null);
    }
}
